
#ifndef WISHMASTER_RECAPTCHAFETCHER_H
#define WISHMASTER_RECAPTCHAFETCHER_H

#include <memory>
#include "captchafetchers/captchafetcher.h"

namespace Wishmaster
{
	class RecaptchaFetcherImpl;
	class RecaptchaFetcher : public CaptchaFetcher
	{
		Q_OBJECT
		Q_INTERFACES(Wishmaster::CaptchaFetcher)
	public:
		RecaptchaFetcher();
		virtual ~RecaptchaFetcher();

		virtual QString id();
		virtual CaptchaFetcher* clone(Connector* connector, const QVariantMap& params);

		virtual void fetchCaptcha(const ThreadId& threadId);
		virtual void processRequest(const PostDescriptor& post, const QString& captcha, const RequestPtr& request);

	private slots:
		void captcha_result(const ThreadId& id, const QByteArray& arr);

	private:
		std::auto_ptr<RecaptchaFetcherImpl> impl;
	};
}

#endif

